$OpenBSD: patch-Modules_FindWish_cmake,v 1.4 2014/09/11 10:24:38 dcoppa Exp $
--- Modules/FindWish.cmake.orig	Thu Jul 31 17:03:56 2014
+++ Modules/FindWish.cmake	Wed Sep  3 08:10:09 2014
@@ -29,14 +29,21 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+set(MODTCL_VERSION $ENV{MODTCL_VERSION})
+set(MODTK_VERSION $ENV{MODTK_VERSION})
+
 if(UNIX)
   find_program(TK_WISH cygwish80 )
 endif()
 
 get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
 get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-string(REGEX REPLACE
-  "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
+if(MODTCL_VERSION)
+  set(TCL_TCLSH_VERSION "${MODTCL_VERSION}")
+else(MODTCL_VERSION)
+  string(REGEX REPLACE
+    "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
+endif(MODTCL_VERSION)
 
 get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
 get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
@@ -75,16 +82,22 @@ if(WIN32)
     )
 endif()
 
-set(TK_WISH_NAMES
-  wish
-  wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
-  wish86 wish8.6
-  wish85 wish8.5
-  wish84 wish8.4
-  wish83 wish8.3
-  wish82 wish8.2
-  wish80 wish8.0
-  )
+if(MODTK_VERSION)
+  set(TK_WISH_NAMES
+    wish${MODTK_VERSION}
+    )
+else(MODTK_VERSION)
+  set(TK_WISH_NAMES
+    wish
+    wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
+    wish86 wish8.6
+    wish85 wish8.5
+    wish84 wish8.4
+    wish83 wish8.3
+    wish82 wish8.2
+    wish80 wish8.0
+    )
+endif(MODTK_VERSION)
 
 find_program(TK_WISH
   NAMES ${TK_WISH_NAMES}
